import ajax from './ajax'
import majax from './majax'
import gajax from './gajax'

//获取首页推荐
export const reqrecommendList = (timestamp)=>ajax.get(`/xhr/index.json?__timestamp=${timestamp}`)

//获取某个频道
export const reqitemList = (timestamp,categoryId) =>ajax.get(`/item/list.json?__timestamp=${timestamp}&categoryId=${categoryId}`)

// 获取值得买导航
export const reqBuyNav = () =>ajax.get('/topic/v1/know/navWap.json')
// 获取值得买瀑布流
export const reqBuyList = ()=>ajax.get('/topic/v1/find/recAuto.json?page=2&size=2')

//默认关键字和热门关键字
export const getHotList=()=>ajax.get('/xhr/search/init.json')

export const reqsearchAuto=(keywordPrefix)=>ajax.post(`/xhr/search/searchAutoComplete.json?keywordPrefix=${keywordPrefix}`)

export const reqsearchInfo=(keyword)=>ajax.get(`/xhr/search/search.json?__timestamp=1630133434953&needPopWindow=true&searchWordSource=7&stillSearch=false&_stat_search=autoComplete&itemId=0&size=40&upperPrice=-1&floorPrice=-1&matchType=0&categoryId=0&descSorted=false&sortType=0&keyword=${keyword}`)


//为你推荐’和分类列表的数据
export const reqListInfo=()=>ajax.get(`/item/cateList.json?__timestamp=1630131286110&categoryId=`)

//获取分类数据
export const reqCategoryDatas=(categoryId)=>ajax.get(`/item/cateList.json?timestamp=1630131455012&categoryId=${categoryId}`)

export const reqDetailInfo=(id)=>majax.get('/item/'+id)
// login登录请求
export const reqLogin = (params) => majax.post('/user/passport/login',params)
// 根据token获取用户信息
export const reqLoginInfo=()=>majax.get('/user/passport/auth/getUserInfo')



//获取otherimage数据

export const reqotherimage=()=>ajax.get(`/item/cateList.json?timestamp=1630131455012&categoryId=`)

// // 购物车
// export const reqCar = ()=>ajax.get('/api/cart/cartList')


// export const reqotherimage=()=>ajax.get(`/item/cateList.json?timestamp=1630131455012&categoryId=${categoryId}`)
// 购物车
export const reqCar = ()=>gajax.get('/api/cart/cartList')

//分类其他列表
export const reqCategorysList = (categoryId)=>ajax.get(`/item/list.json?__timestamp=1630133942864&categoryType=0&subCategoryId=${categoryId}&categoryId=1010000`)


